package platform.user.auth;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;
import platform.user.model.User;

/**
 * 提供认证数据
 *
 * @author roamer
 * @version V1.0
 * @date 2019-03-10 15:29
 */
public class UserDetailsAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider {


    @Override
    protected void additionalAuthenticationChecks(
            UserDetails userDetails, UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken) throws
                                                                                                              AuthenticationException {

    }

    @Override
    protected UserDetails retrieveUser(
            String s, UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken) throws
                                                                                               AuthenticationException {
        return new platform.user.auth.UserDetails(new User());
    }
}
